//
//  HomeTopModel.m
//  markmap
//
//  Created by 甘世清 on 2024/4/26.
//

#import "HomeTopModel.h"

@implementation HomeTopModel
+ (NSDictionary *)mj_replacedKeyFromPropertyName{
   return @{@"userid": @"id"};
}
- (BOOL)show{
    if (self.type==0) {
        return NO;
    } else  if (self.type==1) {
        return YES;
    } else  if (self.type==2) {
        return NO;
    }else  if (self.type==3) {
        return YES;
   }else  if (self.type==4) {
       return YES;
  }
    return NO;
}
- (NSString *)url{
    NSString * urlstring = Url57;
    if (self.type==0) {
        urlstring = Url21;
    } else  if (self.type==1) {
        urlstring = Url32;
    } else  if (self.type==2) {
        urlstring = Url30;
    }else  if (self.type==3) {
        urlstring = Url31;
   }else  if (self.type==4) {
       urlstring = Url33;
   }else if (self.type ==5){
       urlstring = Url57;
   }
    return urlstring;
}
- (NSString *)topString{
    NSString * topString = SQNSLocalString(@"查看此区域觅点");
    if (self.type==0) {
        topString = SQNSLocalString(@"查看此区域觅点");
    } else  if (self.type==1) {
        topString = SQNSLocalString(@"查看此区域觅友");
    } else  if (self.type==2) {
        topString = SQNSLocalString(@"刷新最新觅点");
    }else  if (self.type==3) {
        topString = SQNSLocalString(@"刷新最新觅友");
   }else  if (self.type==4) {
       topString = SQNSLocalString(@"刷新在线觅友");
  }
    return topString;
}
- (NSString *)messageString{
    NSString * topString = SQNSLocalString(@"该地区暂无觅点");
    if (self.type==0) {
        topString = SQNSLocalString(@"该地区暂无觅点");
    } else  if (self.type==1) {
        topString = SQNSLocalString(@"该地区暂无觅友");
    } else  if (self.type==2) {
        topString = SQNSLocalString(@"暂无最新觅点");
    }else  if (self.type==3) {
        topString = SQNSLocalString(@"暂无最新觅友");
   }else  if (self.type==4) {
       topString = SQNSLocalString(@"暂无在线觅友");
  }
    return topString;
}
//处理返回的数据
+(NSArray*)SQ_GetArray:(BaseModel*)model type:(int)type{
//
    if (type == 0 || type ==1) {
        NSArray * array = [PointModel mj_objectArrayWithKeyValuesArray:model.data];
        return array;
    }  else  if (type==2 || type ==3 || type ==4) {
        NSDictionary * data = [[NSDictionary alloc]initWithDictionary:model.data];
        NSArray * array = [PointModel mj_objectArrayWithKeyValuesArray:[data objectForKey:@"records"]];
        return array;
    } 
    return [NSArray new];
}

@end
